package dtd.PHS.VND_ExchangeRate.data;

import java.text.SimpleDateFormat;
import java.util.Date;

public class MyDate {

	int year;
	int month;
	int day;
	
	public MyDate() {
		init(2011,7,3);
	}
	
	public MyDate(int y,int m,int d) {
		init( y, m, d );
	}
	
	public MyDate(String inputDate) {
		String[] words = inputDate.split("/");
		day = Integer.parseInt(words[0].trim());
		month = Integer.parseInt(words[1].trim());
		year = Integer.parseInt(words[2].trim());
	}

	private void init(int y, int m, int d) {
		year = y;
		month = m;
		day = d;
	}
	
	public int getYear() {
		return year;
	}
	
	public void setYear(int year) {
		this.year = year;
	}
	
	public int getMonth() {
		return month;
	}
	
	public void setMonth(int month) {
		this.month = month;
	}
	
	public int getDay() {
		return day;
	}
	
	public void setDay(int day) {
		this.day = day;
	}
	
	@Override
	public String toString() {
		String str = "" + day + "/" + month + "/" + year;
		return str;
	}
	
	public String toStandardDateString() {
		Date date = new Date(year,month,day);
		SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
		return sdf.format(date);
	}
}
